package com.oms.runningdata;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import com.oms.domain.City;
import com.oms.domain.Province;
import com.oms.domain.User;
import com.oms.service.CityService;
import com.oms.service.CollegeService;
import com.oms.service.ProvinceService;
import com.oms.service.UserService;

@Component
public class RuntimeDatabase implements InitializingBean {

	@Resource
	private UserService userService;
	
	@Resource
	private ProvinceService provinceService;
	
	@Resource
	private CityService cityService;
	
	@Resource
	private CollegeService collegeService;
	
	//系统用户
	public static User systemUser;
	
	//系统的省份列表
	public static List<Province> provinceList;
	
	//系统的城市列表
	public static List<City> cityList;
	
	//在线用户列表
	public static List<User> onlineList;

	@Override
	public void afterPropertiesSet() throws Exception {
		
		System.out.println("________________________开始初始化运行时数据库_____________________________");
		
		//初始化系统用户
		systemUser=userService.findById(0);
	}

}
